package com.himiotech.core.project.web.system.monitor;

import com.himiotech.core.project.model.entity.server.Server;
import com.himiotech.core.project.web.base.HimioBaseController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 服务器监控
 *
 * @author ruoyi
 * @author wuwenbin
 */
@Controller
@RequestMapping("/monitor/server")
public class ServerController extends HimioBaseController {

    @Value("${himio.name}")
    private String projectName;

    @RequiresPermissions("monitor:server:view")
    @GetMapping()
    public String server(ModelMap mmp) throws Exception {
        Server server = new Server();
        server.copyTo();
        mmp.put("server", server);
        mmp.put("projectName", projectName);
        return "monitor/server";
    }
}
